home *** CD-ROM | disk | FTP | other *** search
-
- /* $VER: games.e 0.3 (08.09.96)
- ** Includes Release xx.xx
- **
- ** General include file for programs using the Games Master System.
- **
- ** (C) Copyright 1996 DreamWorld Productions.
- ** All Rights Reserved
- */
-
- OPT MODULE
- OPT EXPORT
-
- CONST FILTER_OFF = 0,
- FILTER_ON = 1
-
- CONST LISTSTART = "LIST",
- LISTEND = 0,
- ENDLIST = 0
-
- -> Universal joystick status bits returned from Read_Joystick, Sega,
- -> JoyPad, etc...
-
- CONST JT_SWITCH = 0,
- JT_ZBXY = 1,
-
- JS_LEFT = $00000001,
- JS_RIGHT = $00000002,
- JS_UP = $00000004,
- JS_DOWN = $00000008,
- JS_ZIN = $00000010,
- JS_ZOUT = $00000020,
- JS_FIRE1 = $00000040, -> Fire Buttons
- JS_FIRE2 = $00000080, -> <-For 2 button joysticks
-
- JS_RED = $00000040,
- JS_BLUE = $00000080,
- JS_PLAY = $00000100, -> CD32 buttons here
- JS_RWD = $00000200,
- JS_FFW = $00000400,
- JS_GREEN = $00000800,
- JS_YELLOW = $00001000,
-
- JB_FIRE1 = $00010000, -> For the ZBXY style return type
- JB_FIRE2 = $00020000, -> (analog joysticks)
-
- MB_LMB = $00010000, -> Mouse button flags returned from
- MB_RMB = $00020000, -> Read_Mouse(), in ZBXY format
- MB_MMB = $00040000
-
- -> Joyport specifications for calling Read_JoyStick/Mouse/JoyPad...()
-
- CONST JPORT1 = 0*2,
- JPORT2 = 1*2,
- JPORT3 = 2*2,
- JPORT4 = 3*2
-
- PROC getZBXYx(zb)
- DEF ret:LONG
- MOVE.L zb,D0
- ASR.W #8,D0
- MOVE.L D0,ret
- RETURN ret
- ENDPROC
-
- PROC getZBXYy(zb)
- DEF ret:LONG
- MOVE.L zb,D0
- EXT.W D0
- EXT.L D0
- MOVE.L D0,ret
- RETURN ret
- ENDPROC
-
- -> RasterList support commands.
-
- CONST CM_WAITLINE = 11, CM_COL12 = 00, CM_COL24 = 01, CM_COL12LIST = 02,
- CM_COL24LIST = 03, CM_SPRITE = 04, CM_SCROLL = 05, CM_FLOOD = 07,
- CM_REPOINT = 08, CM_MIRROR = 09, CM_NEWPALETTE = 10, CM_RASTEND = -1
-
- OBJECT waitline
- command :INT
- line :INT
- reserved :LONG
- ENDOBJECT
-
- OBJECT col12
- command :INT
- colour :INT
- value :INT
- reserved :LONG
- ENDOBJECT
-
- OBJECT col24
- command :INT
- colour :INT
- value :LONG
- reserved :LONG
- ENDOBJECT
-
- OBJECT col12list
- command :INT
- line :INT
- skip :INT
- colour :INT
- colourlist :LONG
- reserved :LONG
- ENDOBJECT
-
- OBJECT col24list
- command :INT
- line :INT
- skip :INT
- colour :INT
- colourlist :LONG
- reserved :LONG
- ENDOBJECT
-
- OBJECT spr
- command :INT
- sprite :LONG
- reserved :LONG
- ENDOBJECT
-
- OBJECT flood
- command :INT
- reserved :LONG
- ENDOBJECT
-
- OBJECT repoint
- command :INT
- bitplane :LONG
- reserved :LONG
- ENDOBJECT
-
- OBJECT mirror
- command :INT
- reserved :LONG
- ENDOBJECT
-
- OBJECT newpalette
- command :INT
- colstart :INT
- amtcols :INT
- palette :LONG
- reserved :LONG
- ENDOBJECT
-
- OBJECT rastend
- command :LONG
- ENDOBJECT
-
- -> GPI ID numbers.
-
- CONST GPI_SCREENS = 0,
- GPI_BLITTER = 4,
- GPI_SOUND = 8,
- GPI_NETWORK = 12,
- GPI_VECTORS = 16,
- GPI_DEBUG = 20,
- GPI_ANIM = 24,
- GPI_REKO = 28
-
- -> Standard screen structure.
-
- CONST GSV1 = $47535631 -> Structure ID (goes in gamescreen.version)
-
- OBJECT gamescreen
- version :LONG -> Structure version - "GSV1"
- stats :LONG -> Private
- memptr1 :LONG -> Ptr to screen 1
- memptr2 :LONG -> Ptr to screen 2 (double buffer)
- memptr3 :LONG -> Ptr to screen 3 (triple buffer)
- screenlink :LONG -> Ptr to a linked screen
- palette :LONG -> Ptr to the screen palette
- rasterlist :LONG -> Ptr to a rasterlist
- amtcolours :LONG -> The amount of colours in the palette.
- scrwidth :INT -> The width of the visible screen
- scrheight :INT -> The height of the visible screen
- picwidth :INT -> The width of the entire screen
- picheight :INT -> The height of the entire screen
- planes :INT -> The amount of planes in da screen
- scrxoffset :INT -> Hardware co-ordinate for TOS
- scryoffset :INT -> Hardware co-ordinate for LOS
- picxoffset :INT -> Offset of the horizontal axis
- picyoffset :INT -> Offset of the vertical axis
- attributes :LONG -> Special Attributes are?
- mode :INT -> What screen mode is it?
- type :CHAR -> Interleaved/Planar/Chunky?
- displayed :CHAR -> Private
- ENDOBJECT
-
- -> SCREEN TYPES (flags for SS_ScrType)
-
- CONST INTERLEAVED = 0, -> These are actual numbers
- PLANAR = 1, -> rather than bits
- CHUNKY = 2
-
- -> SCREEN ATTRIBUTES (flags and bits for SS_ScrAttrib)
-
- CONST DBLBUFFER = $00000001, -> For double buffering
- TPLBUFFER = $00000002, -> Triple buffering!!
- PLAYFIELD = $00000004, -> Set if it's part of a playfield
- HSCROLL = $00000008, -> Gotta set this to do scrolling
- VSCROLL = $00000010, -> For vertical scrolling
- SPRITES = $00000020, -> Set this if you want sprites
- HBUFFER = $00000040, -> Creates a scroll buff for up to 100 screens.
- -> = $00000080,
- BLKBDR = $00000100, -> Gives a blackborder on AGA machines
- NOSPRBDR = $00000200 -> For putting sprites in the border
-
- -> SCREEN MODES (flags for SS_ScrMode)
-
- CONST LORES = $0000, -> Low resolution (default)
- HIRES = $0001, -> High resolution
- SHIRES = $0002, -> Super-High resolution
- INTERLACED = $0004, -> Interlaced
- NTSC = $0020, -> Set if you wrote this game in NTSC
- HAM = $0040, -> For HAM mode
- COL24BIT = $0080 -> 24Bit colours (default is 12Bits)
-
- -> Universal errorcodes returned by certain functions.
-
- CONST ERR_OK = 0, -> Function went OK (also NULL)
- ERR_NOMEM = 1, -> Not enough memory available
- ERR_NOPTR = 2, -> Required pointer not present
- ERR_INUSE = 3, -> Previous allocations have not been freed
- ERR_NOVER = 4, -> Structure version not supported or not found
- ERR_FAILED = 5 -> General failure
-
- -> Sprite structure.
-
- CONST SPV1 = $53505631
-
- OBJECT sprite
- version :LONG -> Structure version (SPV1)
- stats :LONG -> Reserved.
- number :INT -> Bank number to access
- data :LONG -> Pointer to Sprite graphic
- xpos :INT -> X position
- ypos :INT -> Y position
- frame :INT -> Frame number
- width :INT -> Width in pixels
- height :INT -> Height in pixels
- amtcolours :INT -> 4 or 16
- colStart :INT -> Colour bank to access, increments of 16
- planes :INT -> Amount of planes per bank
- resolution :INT -> HiRes/LoRes/SHiRes/XLONG
- fieldpriority :INT -> Field position in relation to playfields
- spritesize :LONG -> Reserved
- framesize :LONG -> Reserved
- ENDOBJECT
-
- CONST SPR_OCS = $0010,
- SPR_AGA = $0020,
- XLONG = $0040
-
- -> BOB Drawing Methods
-
- CONST INTLV_NCNM = 00, -> No clip, no mask
- INTLV_NCYM = 01, -> No clip, masked
- INTLV_YCNM = 02, -> Clip, no mask
- INTLV_YCYM = 03, -> Clip, masked
- PLNR_NCNM = 04,
- PLNR_NCYM = 05,
- PLNR_YCNM = 06,
- PLNR_YCYM = 07,
- CHNKY_NCNM = 08,
- CHNKY_NCYM = 09,
- CHNKY_YCNM = 10,
- CHNKY_YCYM = 11
-
- -> The picture structure for loading and depacking of pictures.
-
- CONST PCV1 = $50435631
-
- OBJECT picture
- version :LONG -> "PCV1"
- stats :LONG -> Reserved.
- data :LONG -> Source.
- width :INT -> Picture Width
- height :INT -> Picture Height
- planes :INT -> Amount of planes
- amtcolours :LONG -> Amount of colours.
- palette :LONG -> Ptr to Palette.
- scrMode :INT -> Intended screen mode for picture.
- type :INT -> Interleaved/Chunky/Planar
- attrib :LONG -> GETPALETTE/VIDEOMEM/
- ENDOBJECT
-
- -> Choose one of these for calling Set_Interrupt().
-
- CONST INTB_INTEN = 14, -> Master interrupt (enable only )
- INTB_EXTER = 13, -> External interrupt
- INTB_DSKSYNC = 12, -> Disk re-SYNChronized
- INTB_RBF = 11, -> serial port Receive Buffer Full
- INTB_AUD3 = 10, -> Audio channel 3 block finished
- INTB_AUD2 = 9, -> Audio channel 2 block finished
- INTB_AUD1 = 8, -> Audio channel 1 block finished
- INTB_AUD0 = 7, -> Audio channel 0 block finished
- INTB_BLIT = 6, -> Blitter finished
- INTB_VERTB = 5, -> start of Vertical Blank
- INTB_COPER = 4, -> Coprocessor
- INTB_PORTS = 3, -> I/O Ports and timers
- INTB_SOFTINT = 2, -> software interrupt rest
- INTB_DSKBLK = 1, -> Disk Block done
- INTB_TBE = 0 -> serial port Transmit Buffer Empty
-
- -> Special Keypresses that can be returned from Read_Key(). All other
- -> keys can be considered to be in ASCII format.
-
-
- OBJECT keys
- id :INT
- key1 :CHAR
- key2 :CHAR
- key3 :CHAR
- key4 :CHAR
- ENDOBJECT
-
- CONST K_SCS = $80, -> Screen switch (LEFTAMIGA + M)
- K_DEL = $81,
- K_HELP = $82,
- K_LSHIFT = $83,
- K_RSHIFT = $84,
- K_CAPS = $85,
- K_CTRL = $86,
- K_LALT = $87,
- K_RALT = $88,
- K_LAMIGA = $89,
- K_RAMIGA = $8a,
-
- K_F1 = $8b,
- K_F2 = $8c,
- K_F3 = $8d,
- K_F4 = $8e,
- K_F5 = $8f,
- K_F6 = $90,
- K_F7 = $91,
- K_F8 = $92,
- K_F9 = $93,
- K_F10 = $94,
- K_F11 = $95,
- K_F12 = $96,
- K_F13 = $97,
- K_F14 = $98,
- K_F15 = $99,
- K_F16 = $9a,
- K_F17 = $9b,
- K_F18 = $9c,
- K_F19 = $9d,
- K_F20 = $9e,
-
- C_UP = $9f,
- C_DOWN = $a0,
- C_RIGHT = $a1,
- C_LEFT = $a2,
-
- K_SRIGHT = $a3, -> Special key on right
- K_SLEFT = $a4, -> Special key on left
-
- K_TAB = 09,
- K_BAKSPC = 08,
- K_ENTER = 10,
- K_RETURN = 10,
- K_ESC = ""
-